package com.tang.algorithm.array;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author tlm
 * @version 1.0
 * @date 2020/6/5 5:01 下午
 */
public class LeetCode1389 {
    public static void main(String[] args) {

    }
    public int[] createTargetArray(int[] nums, int[] index) {
        int length = index.length;
        List<Integer> res = new ArrayList<>();
        for (int i = 0; i <length ; i++) {
            res.add(index[i],nums[i]);
        }
        int[] res1 = new int[length];
        for (int i = 0; i <length ; i++) {
            res1[i]=res.get(i);
        }
        return res1;
    }
}
